package unit2_1010.test5;

import java.util.Scanner;

public class Test {

	@SuppressWarnings("resource")
	public static void main(String[] args) {
		
		Scanner scanner = new Scanner(System.in);
		
		System.out.println("宠物信息：\n1.狗\n2.猫");
		System.out.print("请选择：");
		int choice = scanner.nextInt();
		switch (choice) {
		case 1:
			System.out.println("您选择了宠物狗");
			Dog dog = new Dog();
			System.out.print("请输入狗的昵称：");
			dog.setName(scanner.next());
			System.out.print("请输入狗的性别：1.雄\t2.雌\\t--->");
			dog.setSex(scanner.nextInt()==1?"雄":"雌");
			System.out.print("请输入健康值（1-100）：");
			dog.setHealth(scanner.nextInt());
			System.out.print("请输入与主人的亲密度（1-10）：");
			dog.setLove(scanner.nextInt());
			dog.show();
			break;
		case 2:
			System.out.println("您选择了宠物猫");
			Cat cat = new Cat();
			System.out.print("请输入猫的昵称：");
			cat.setName(scanner.next());
			System.out.print("请输入猫的性别：1.雄\t2.雌\t--->");
			cat.setSex(scanner.nextInt()==1?"雄":"雌");
			System.out.print("请输入健康值（1-100）：");
			cat.setHealth(scanner.nextInt());
			System.out.print("请输入懒度（1-10）：");
			cat.setLazy(scanner.nextInt());
			cat.show();			
			break;
		default:
			System.out.println("输入有误");
			break;
		}
		
		
		
	}

}
